
/* MT sidebar rolante */
:root { --sidebar-w: 180px; }
.sidebar {
  background: #1C2331;
  color: #fff;
  width: var(--sidebar-w);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 20px;
  position: sticky;
  top: 0;
  align-self: flex-start; /* needed for sticky inside flex parent */
  height: 100dvh;
  overflow-y: auto; /* painel rolante */
}
.layout { align-items: flex-start; }

/* Layout base */
body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f4f6f9;
  color: #2c3e50;
}

.layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  background: #1C2331;
  color: #fff;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 20px;
  
  
  
}

.sidebar h2 {
  font-size: 20px;
  margin-bottom: 20px;
  text-align: center;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar nav a {
  color: #ecf0f1;
  text-decoration: none;
  padding: 10px 10px 10px 20px; /* top right bottom left */
  border-radius: 6px;
  transition: 0.2s;
  display: block; /* garante que ocupa largura toda */
}

.sidebar nav a:hover {
  background: #2980b9;
}

.sidebar nav a.logout {
  margin-top: auto;
  background: #c0392b;
  text-align: center;
}

.sidebar nav a.logout:hover {
  background: #e74c3c;
}

/* Conteúdo */
.content {
  flex: 1;
  padding: 20px;
  padding-left: 60px; /* agora empurra mais o texto */
}

/* Tabelas */
.table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
}

.table th, .table td {
  padding: 10px;
  border-bottom: 1px solid #ddd;
  text-align: left;
}

.table th {
  background: #ecf0f1;
}

/* Botões */
button, .btn {
  background: #2980b9;
  border: none;
  color: #fff;
  padding: 8px 14px;
  border-radius: 5px;
  cursor: pointer;
  text-decoration: none;
}

button:hover, .btn:hover {
  background: #1f5d89;
}

/* Responsivo */
@media (max-width: 768px) {
  /* removed old offcanvas absolute positioning for sidebar */
  .sidebar.active {
    left: 0;
  }
  .content {
    
  }
}

/* Rodapé fixo */
.footer {
  background: #2c3e50;
  color: #ecf0f1;
  text-align: center;
  padding: 10px;
  font-size: 14px;
  position: fixed;
  bottom: 0;
  right: 0;
  border-top: 2px solid #34495e;
}

.footer a {
  color: #1abc9c;
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

/* === Formulários Modernos === */
.form-container {
  background: #fff;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  max-width: 500px;
  margin: auto;
}

.form-container h2 {
  margin-bottom: 20px;
  color: #2c3e50;
  text-align: center;
}

.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
  color: #34495e;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #bdc3c7;
  border-radius: 6px;
  font-size: 14px;
}

.form-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 20px;
}

.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}

.btn-primary {
  background: #3498db;
  color: #fff;
}

.btn-primary:hover {
  background: #2980b9;
}

.btn-secondary {
  background: #7f8c8d;
  color: #fff;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.btn-secondary:hover {
  background: #636e72;
}

/* === Classes para cabeçalho de página e tabelas === */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.table-container {
  background: #fff;
  padding: 15px;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

table th, table td {
  padding: 10px;
  border-bottom: 1px solid #eee;
  text-align: left;
}

table th {
  background: #f7f9fb;
  font-weight: bold;
  color: #333;
}

.btn-small {
  padding: 5px 10px;
  font-size: 12px;
}

/* === Classes do Dashboard Cards === */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); /* caixas mais estreitas */
  gap: 12px; /* menos espaço entre elas */
  margin-top: 20px;
}

.card {
  background: #fff;
  padding: 12px; /* menos padding para caixas menores */
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  text-align: center;
  transition: transform 0.2s;
  min-width: 0; /* Permite que o cartão se encolha */
}

.card:hover {
  transform: translateY(-4px);
}

.card h3 {
  font-size: 1.3rem; /* levemente menor */
  color: #1976d2;
  margin: 0;
}

.card p {
  margin-top: 8px;
  color: #555;
  font-weight: bold;
}

/* === Estilos da Tabela de Agendamentos do Dashboard === */
.dashboard-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.dashboard-table th, .dashboard-table td {
  padding: 12px 15px;
  text-align: left;
}

.dashboard-table th {
  background: #1976d2;
  color: #fff;
  text-transform: uppercase;
  font-size: 14px;
}

.dashboard-table tr:nth-child(even) {
  background: #f9f9f9;
}

.dashboard-table tr:hover {
  background: #eaf3ff;
}

/* === Estilos do Gráfico Canvas === */
canvas {
  margin-top: 20px;
  background: #fff;
  padding: 15px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

#graficoTipos {
  margin-top: 20px;
  background: #fff;
  padding: 15px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.content h2, .content h3 {
  margin-left: 0;
}

/* === NOVAS CLASSES ADICIONADAS: Grid de Cards no Dashboard === */
.dashboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.dashboard .card {
  background: #fff;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  text-align: center;
  transition: transform 0.2s;
}

.dashboard .card:hover {
  transform: translateY(-5px);
}

.dashboard .card span {
  font-size: 1.8rem;
  font-weight: bold;
  color: #1976d2;
  display: block;
}

.dashboard .card h3 {
  margin-top: 10px;
  font-size: 1rem;
  color: #333;
}
.sidebar a{display:flex;align-items:center;gap:.8rem;white-space:nowrap}

/* === Sidebar overlap fix (drop-in override) ===
   Colar no fim do seu style.css ou incluir como ficheiro separado depois do style.css
*/
:root { --sidebar-w: 270px; }                    /* mantenha em sincronia com a largura do sidebar */
.sidebar { width: var(--sidebar-w) !important; }
body, .layout { overflow-x: hidden; }

/* Empurra todo o conteúdo para a direita da sidebar fixa */
.content {
  
  padding-right: 12px;
}

/* Garante que cards/tabelas não ficam cortados */
.content .container,
.content .container-fluid {
  max-width: 100%;
  padding-left: 0 !important;
  padding-right: 12px !important;
}

/* Opcional: reduza ligeiramente a largura máxima dos "cards" do dashboard em ecrãs muito largos */
@media (min-width: 1400px) {
  .dashboard { grid-template-columns: repeat(4, minmax(220px, 1fr)); }
}

/* Sidebar recolhido em mobile */
@media (max-width: 992px) {
  .content {  }
}

/* Impressão: esconde sidebar e usa página cheia */
@media print {
  .sidebar { display: none !important; }
  .content {  }
}

/* ==== MT Responsive helpers (safe) ==== */
img, video, canvas, svg { max-width: 100%; height: auto; }
iframe { max-width: 100%; }
.table td, .table th { vertical-align: middle; }

/* Stack long label/value pairs on tiny devices */
@media (max-width: 575.98px){
  .form-label { margin-bottom: .25rem; }
  .btn-group { flex-wrap: wrap; }
}

/* Prevent content touching edges on very small screens */
@media (max-width: 575.98px){
  .content { padding-left: 12px; padding-right: 12px; }
}
